/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.io.FileInputStream;

/**
 * <p>Project: jse2303 - Ex6
 * <p>Powered by webrx On 2023-07-24 09:35:27
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex6 {
    public static void main(String[] args) {
        String f = "d:/b.mp4";
        //jpg ffd8ffe11c8545786966
        //zip 504b0304000000000000
        //b.mp4 504b0304000000000000 zip压缩
        try (var is = new FileInputStream(f)) {
            byte[] buf = new byte[10];
            is.read(buf);
            StringBuilder sbu = new StringBuilder();
            for (byte b : buf) {
                sbu.append(String.format("%02x", b));
            }
            System.out.println(sbu);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
